<?php echo $this->headLink()->appendStylesheet($this->websiteUrl . '/system/css/seotoaster.css'); ?>
<?php echo $this->headLink()->appendStylesheet($this->websiteUrl . 'system/js/thickbox/thickbox.css'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl .'system/js/jquery/jquery.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/thickbox/thickbox.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/php.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/quote/quote.js'); ?>
<?php $this->headScript()->appendFile($this->websiteUrl . 'system/js/shoppingforcontent/shoppingforcontent.js'); ?>
<?php echo $this->headScript(); ?>
<div id="seotoaster" class="shoppingeditquote">
	<div id="editquotewrapper">
		<div class="success" style="display: none;" id="ajaxmsg"></div>
		<input type="hidden" id="wsurl-hidden" value="<?php echo $this->websiteUrl; ?>"/>
		<input type="hidden" id="qid-hidden" value="<?php echo $this->cartId; ?>"/>
		<input type="hidden" id="quoteId-hidden" value="<?php echo $this->quoteId; ?>"/>
		<!--div class="admineditwhat">{%Quote%}</div-->
		<!--div class="close_window" onclick="parent.tb_remove();"></div-->
		<div id="sc-groupbrands" style="display: none;">
			<a id="closeeditquote" href="javascript:;" onclick="$(this).parent().hide();"><img src="<?php echo $this->websiteUrl; ?>system/images/bg-close.png" alt="close" border="0"/></a>
			<p class="lbl">{%Categories%}</p>
			<div id="sc-groups"></div>
			<p class="lbl">{%Brands%}</p>
			<div id="sc-brands"></div>
			<p class="lbl">{%Products%}</p>
			<div id="sc-products"></div>
		</div>
		<div id="quoteedittophead">
			<div id="companyinfo">
				<img src="<?php echo $this->websiteUrl . $this->shoppingConfig['company_logo']; ?>" alt="company logo"/><br/>
				<?php echo $this->shoppingConfig['company']; ?><br/>
				<?php echo $this->shoppingConfig['email']; ?>
			</div>
			<div id="clientinfo">
				<?php //if($this->needsUpdate): ?>
					<div id="updaquotedata">
						<p>{%Quote Reference%}:&nbsp;<input type="text" id="qupdName" value="<?php echo $this->quoteName;?>" /></p>
						<p>{%User email%}:&nbsp;<input type="text" id="qupdMail" value="<?php echo $this->userMail;?>" /></p>
						<div style="display: none;" id="moreusrdata">
							<div id="popuphint">{%Edit additional user info%}</div>
							<p><span>{%Country%}:</span><input type="text" name="cart-quote-country" id="cart-quote-country" value="<?php echo $this->additionalUserData['country'];?>"/></p>
							<p><span>{%State%}:</span><input type="text" name="cart-quote-state" id="cart-quote-state" value="<?php echo $this->additionalUserData['state'];?>"/></p>
							<p><span>{%City%}:</span><input type="text" name="cart-quote-city" id="cart-quote-city" value="<?php echo $this->additionalUserData['city'];?>"/></p>
							<p><span>{%Zip%}:</span><input type="text" name="cart-quote-zip" id="cart-quote-zip" value="<?php echo $this->additionalUserData['zip'];?>"/></p>
							<p><span>{%Address%} 1:</span><input type="text" name="cart-quote-address1" id="cart-quote-address1" value="<?php echo $this->additionalUserData['address1'];?>"/></p>
							<p><span>{%Address%} 2:</span><input type="text" name="cart-quote-address2" id="cart-quote-address2" value="<?php echo $this->additionalUserData['address2'];?>"/></p>
							<p><span>{%Phone%}:</span><input type="text" name="cart-quote-phone" id="cart-quote-phone" value="<?php echo $this->additionalUserData['phone'];?>"/></p>
							<p align="right"><a href="javascript:;" onclick="$('#moreusrdata').toggle();">{%Close%}</a>&nbsp;<button onclick="updateQuoteData(<?php echo $this->quoteId; ?>);">{%Update%}</button></p>
						</div>
						<p align="right"><a href="javascript:;" onclick="$('#moreusrdata').toggle();">{%Fill more user data%}</a><button onclick="updateQuoteData(<?php echo $this->quoteId; ?>);">{%Update%}</button></p>
					</div>
				<?php //else: ?>
					<?php //echo $this->quoteName;?><!--br/-->
					<?php //echo $this->userMail;?>
				<?php // endif; ?>
			</div>
		</div>
		<div>
			<h1>{%Quote%}&nbsp;[<?php echo $this->quoteName;?>]&nbsp;{%edit%}</h1>
		</div>
		<div id="usercart-holder">
			<div id="usercart-legend">
				<div>{%Photo%}</div>
				<div>{%Product%}</div>
				<div>{%Note%}</div>
				<div>{%Qty%}</div>
				<div>{%Price%}</div>
				<!--div>{%Remove%}</div-->
			</div>
			<div id="usercart">
				<?php if(!empty($this->cartData)): ?>
					<?php foreach ($this->cartData as $id => $cartItem): ?>
						<div class="usercart-item-product">
							<div><img src="<?php echo $this->websiteUrl . $cartItem['photo']; ?>" width="50" height="50" alt="<?php echo $cartItem['name']; ?>"/></div>
							<div>
								<?php echo $cartItem['name']; ?>
								<?php if(isset($cartItem['options'])): ?>
									<?php foreach($cartItem['options'] as $optName => $optVal): ?>
										<?php if($optVal != 'select' . $optName): echo $optName . ': ' . $optVal; endif; ?>
									<?php endforeach; ?>
								<?php endif; ?>
							</div>
							<div><input type="text" class="adminnote" value="<?php echo $cartItem['note']; ?>" id="adminnote-<?php echo $id; ?>" /></div>
							<div><input type="text" class="itqty" value="<?php echo $cartItem['count']; ?>" id="inptoupdcnt-<?php echo $id; ?>" /></div>
							<div><input type="text" class="itprice" value="<?php echo $cartItem['price']; ?>" id="inptoupd-<?php echo $id; ?>" /></div>
							<!--div><input type="checkbox" name="remove[]" id="chkbxtorem-<?php echo $id; ?>" /></div-->
						</div>
					<?php endforeach; ?>
				<?php endif; ?>
			</div>
			<div id="statusline">
				<div id="buttons">
					<button class="formsubmit" id="addprod">{%Add product%}</button>
					<button class="formsubmit" id="updCart">{%Update cart%}</button>
				</div>
				<div id="total">
					{%Total price%}:&nbsp;<?php echo $this->totalPrice; ?>
				</div>
			</div>
		</div>
		<div id="msgholder">
			<div id="mailuserwin">
				<div class="lbl">{%User mail text%}</div>
				<textarea id="mailusertext" cols="22" rows="6"><?php echo $this->mailToUser; ?></textarea>
			</div>
			<div id="internalmsgwin">
				<div class="lbl">{%Internal note%}</div>
				<textarea id="intmsgtext" cols="22" rows="6"><?php echo trim($this->quoteIntMsg); ?></textarea>
			</div>
		</div>
		<div id="bottomline">
			<div id="addinfo">
				<?php if($this->hasPreview): ?>
					<a target="_blank" href="<?php echo $this->websiteUrl; ?>sys/backend_quote/preview/qid/<?php echo $this->quoteId .'.'. md5($this->quoteId) . '.' . $this->quoteId; ?>">{%Quote preview%}</a>
				<?php endif;?>
			</div>
			<div id="donebtn">
				<button id="generateQuote" class="formsubmit">{%Save quote%}</button>
			</div>
		</div>
	</div>
</div>